import {
  Entity,
  Column,
  PrimaryGeneratedColumn,
  CreateDateColumn,
} from 'typeorm';
import { IsUrl } from 'class-validator';
@Entity()
export class Film {
  @PrimaryGeneratedColumn('uuid')
  id: number;

  @Column({ type: 'varchar', length: 255 })
  name: string;

  @Column()
  type: number;

  @Column({ type: 'text' })
  content: string;

  @Column()
  country: number;

  @Column()
  @IsUrl()
  poster: string;

  @CreateDateColumn({ type: 'timestamp' })
  releaseTime: Date;
}
